Strict

Import mojo
Import agfx

Class TSound
	Field name:String
	Field sound:Sound
	Field rate:Float = 1
	Field pan:Float = 0
	Field volume:Float = 1
	Field loop:Int = 0
	
	Method Load:Void(file:String)
		#if TARGET="flash" or TARGET="ios" 
			sound = LoadSoundSample(TSoundContainer.path + file +".mp3")
		#else If TARGET="android"
			sound = LoadSoundSample(TSoundContainer.path + file +".ogg")
		#else
			sound = LoadSoundSample(TSoundContainer.path + file +".wav")
		#endif
		
		name = StripAll(file.ToUpper())	
	End
	
	Method Play:Void()
		SFX.Play(sound, pan, rate, volume, loop)
	End
	
	Method Stop:Void()
		SFX.Stop()
	End Method
End


